<template>
  <div>
     <Button type="success" @click="showMenu">成功按钮</Button>
      <transition name="slide-fade">
    <div v-if="leftMenu">

      <Row>
        <Col span="8">
          <Menu :theme="theme2" :open-names="['1']" accordion>
            <Submenu name="1">
              <template slot="title">
                <Icon type="ios-paper"></Icon>
                内容管理
              </template>
              <Menu-item name="1-1">文章管理</Menu-item>
              <Menu-item name="1-2">评论管理</Menu-item>
              <Menu-item name="1-3">举报管理</Menu-item>
            </Submenu>
            <Submenu name="2">
              <template slot="title">
                <Icon type="ios-people"></Icon>
                用户管理
              </template>
              <Menu-item name="2-1">新增用户</Menu-item>
              <Menu-item name="2-2">活跃用户</Menu-item>
            </Submenu>
            <Submenu name="3">
              <template slot="title">
                <Icon type="stats-bars"></Icon>
                统计分析
              </template>
              <Menu-group title="使用">
                <Menu-item name="3-1">新增和启动</Menu-item>
                <Menu-item name="3-2">活跃分析</Menu-item>
                <Menu-item name="3-3">时段分析</Menu-item>
              </Menu-group>
              <Menu-group title="留存">
                <Menu-item name="3-4">用户留存</Menu-item>
                <Menu-item name="3-5">流失用户</Menu-item>
              </Menu-group>
            </Submenu>
          </Menu>
        </Col>
      </Row>
    </div>
</transition>
    <br />
    <div>
      <p>切换主题</p>
      <Radio-group v-model="theme2">
        <Radio label="light"></Radio>
        <Radio label="dark"></Radio>
      </Radio-group>
    </div>
  </div>
</template>
<script>
export default {
  data () {
    return {
      theme2: 'light',
      leftMenu: false
    }
  },
  methods: {
    showMenu () {
      this.leftMenu = !this.leftMenu
    }
  }
}
</script>

<style lang="less">
.slide-fade-enter-active {
  transition: all 0.3s ease;
  position: absolute;

}
.slide-fade-leave-active {
  transition: all .5s cubic-bezier(1.0, 0.5, 0.8, 1.0);
}
.slide-fade-enter, .slide-fade-leave-to
/* .slide-fade-leave-active 用于 2.1.8 以下版本 */ {
  transform: translateX(10px);
  opacity: 0;
}</style>
